import Vue from 'vue'
import VueRouter from 'vue-router'

// 固定的视图
import Home from '@/views/Home.vue'
import TodoWork from '@/views/myActiviti/TodoWork.vue'
import FinishedWork from '@/views/myActiviti/FinishedWork.vue'
import UploadActiviti from '@/views/configActiviti/UploadActiviti.vue'
import Org from '@/views/orgConfig/Org.vue'

Vue.use(VueRouter)

// 获取原型对象push函数
const originalPush = VueRouter.prototype.push

// 获取原型对象replace函数
const originalReplace = VueRouter.prototype.replace

// 修改原型对象中的push函数
VueRouter.prototype.push = function push(location){
return originalPush.call(this , location).catch(err=>err)
}

// 修改原型对象中的replace函数
VueRouter.prototype.replace = function replace(location){
return originalReplace.call(this , location).catch(err=>err)
}


const router = new VueRouter({
    routes:[
      {
        path:'/',
        component:Home
      },
      {
        path:'/myActiviti/TodoWork',
        component:TodoWork
      },
      {
        path:'/myActiviti/FinishedWork',
        component:FinishedWork
      },
      {
        path:'/configActiviti/UploadActiviti',
        component:UploadActiviti
      },
      {
        path:'/orgConfig/Org',
        component:Org
      },
    ]
  })


export default router



















